fastest way to check odd or even in python

35

>>> def isodd(num):
        return num & 1 and True or False

>>> isodd(10)
False
>>> isodd(9)
True

Comments

Submit
0 Comments